<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ClockDay
 *
 * @author BUI VAN UY
 */
class ClockDay
{

    public function __construct()
    {
        $this->work = new Clock();
    }

    /**
     * date
     * @var date 
     */
    public $date;
    public $dayName;

    /**
     *
     * @var Clock
     */
    public $work;

    /**
     *
     * @var array
     */
    public $lunchs     = array();
    private $totalTime = NULL;

    public function getTotalTime()
    {
        if ($this->totalTime != NULL)
            return $this->totalTime;
        $this->totalTime = $this->work->totalTime;
        foreach ($this->lunchs as $lunch)
        {
            $this->totalTime -= $lunch->totalTime;
        }
        return $this->totalTime;
    }

}

?>
